const list = [
    {
        id: 35940,
        createdDate: '2023-06-05 07:43:59',
        amount: 60,
        useCondition: 800,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35936,
        createdDate: '2023-06-05 07:43:00',
        amount: 70,
        useCondition: 800,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35935,
        createdDate: '2023-06-05 07:42:58',
        amount: 40,
        useCondition: 700,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35738,
        createdDate: '2023-06-04 06:21:30',
        amount: 25,
        useCondition: 200,
        expiresDate: '2023-08-03 23:59:59'
    },
    {
        id: 35726,
        createdDate: '2023-06-04 00:18:02',
        amount: 25,
        useCondition: 200,
        expiresDate: '2023-08-03 23:59:59'
    },
    {
        id: 35973,
        createdDate: '2023-06-05 08:14:12',
        amount: 25,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35939,
        createdDate: '2023-06-05 07:43:57',
        amount: 25,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35928,
        createdDate: '2023-06-05 07:41:52',
        amount: 25,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35930,
        createdDate: '2023-06-05 07:42:11',
        amount: 25,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35921,
        createdDate: '2023-06-05 07:38:40',
        amount: 25,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35737,
        createdDate: '2023-06-04 06:21:27',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-03 23:59:59'
    },
    {
        id: 35734,
        createdDate: '2023-06-04 06:21:20',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-03 23:59:59'
    },
    {
        id: 35736,
        createdDate: '2023-06-04 06:21:25',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-09-02 23:59:59'
    },
    {
        id: 35727,
        createdDate: '2023-06-04 00:18:08',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-09-02 23:59:59'
    },
    {
        id: 35974,
        createdDate: '2023-06-05 08:14:14',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 34696,
        createdDate: '2023-05-30 14:28:48',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-07-29 23:59:59'
    },
    {
        id: 35925,
        createdDate: '2023-06-05 07:40:15',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35924,
        createdDate: '2023-06-05 07:40:13',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 34744,
        createdDate: '2023-05-31 07:14:29',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-07-30 23:59:59'
    },
    {
        id: 34690,
        createdDate: '2023-05-30 14:27:04',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-07-29 23:59:59'
    },
    {
        id: 35927,
        createdDate: '2023-06-05 07:41:49',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35910,
        createdDate: '2023-06-05 07:33:26',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 34847,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
    },
    {
        id: 34846,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
    },
    {
        id: 34845,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
    },
    {
        id: 34844,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
    },
    {
        id: 35915,
        createdDate: '2023-06-05 07:34:41',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35916,
        createdDate: '2023-06-05 07:34:44',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-09-03 23:59:59'
    },
    {
        id: 35929,
        createdDate: '2023-06-05 07:42:09',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-09-03 23:59:59'
    },
    {
        id: 35920,
        createdDate: '2023-06-05 07:38:36',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35919,
        createdDate: '2023-06-05 07:38:34',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-09-03 23:59:59'
    },
    {
        id: 35970,
        createdDate: '2023-06-05 08:13:15',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35914,
        createdDate: '2023-06-05 07:34:15',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-09-03 23:59:59'
    },
    {
        id: 34263,
        createdDate: '2023-05-28 23:05:35',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-07-27 23:59:59'
    },
    {
        id: 35913,
        createdDate: '2023-06-05 07:33:48',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35912,
        createdDate: '2023-06-05 07:33:46',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-09-03 23:59:59'
    },
    {
        id: 35938,
        createdDate: '2023-06-05 07:43:04',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-09-03 23:59:59'
    },
    {
        id: 34695,
        createdDate: '2023-05-30 14:28:28',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-08-28 23:59:59'
    },
    {
        id: 35735,
        createdDate: '2023-06-04 06:21:22',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-08-03 23:59:59'
    },
    {
        id: 35728,
        createdDate: '2023-06-04 00:18:10',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-08-03 23:59:59'
    },
    {
        id: 34745,
        createdDate: '2023-05-31 07:14:31',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-30 23:59:59'
    },
    {
        id: 35911,
        createdDate: '2023-06-05 07:33:28',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35918,
        createdDate: '2023-06-05 07:38:04',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 34694,
        createdDate: '2023-05-30 14:27:27',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-29 23:59:59'
    },
    {
        id: 35972,
        createdDate: '2023-06-05 08:13:27',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 35971,
        createdDate: '2023-06-05 08:13:26',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 33636,
        createdDate: '2023-05-22 17:34:33',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-21 23:59:59'
    },
    {
        id: 34672,
        createdDate: '2023-05-30 09:28:47',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-29 23:59:59'
    },
    {
        id: 34265,
        createdDate: '2023-05-28 23:06:17',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-27 23:59:59'
    },
    {
        id: 34267,
        createdDate: '2023-05-28 23:06:33',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-27 23:59:59'
    },
    {
        id: 35937,
        createdDate: '2023-06-05 07:43:02',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 34747,
        createdDate: '2023-05-31 07:14:47',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-30 23:59:59'
    },
    {
        id: 35926,
        createdDate: '2023-06-05 07:40:54',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-08-04 23:59:59'
    },
    {
        id: 34854,
        createdDate: '2023-05-31 17:12:56',
        amount: 10,
        useCondition: 1000,
        expiresDate: '2026-05-30 23:59:59'
    },
    {
        id: 34588,
        createdDate: '2023-05-29 16:34:23',
        amount: 5,
        useCondition: 300,
        expiresDate: '2023-06-28 23:59:59'
    },
    {
        id: 34840,
        createdDate: '2023-05-31 17:12:56',
        amount: 30,
        useCondition: 3000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34264,
        createdDate: '2023-05-28 23:06:15',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-08-26 23:59:59'
      },
      {
        id: 34820,
        createdDate: '2023-05-31 17:12:52',
        amount: 20,
        useCondition: 300,
        expiresDate: '2023-06-30 23:59:59'
      },
      {
        id: 34819,
        createdDate: '2023-05-31 17:12:52',
        amount: 20,
        useCondition: 300,
        expiresDate: '2023-06-30 23:59:59'
      },
      {
        id: 34818,
        createdDate: '2023-05-31 17:12:52',
        amount: 20,
        useCondition: 300,
        expiresDate: '2023-06-30 23:59:59'
      },
      {
        id: 34269,
        createdDate: '2023-05-28 23:08:25',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-07-27 23:59:59'
      },
      {
        id: 34781,
        createdDate: '2023-05-31 17:12:32',
        amount: 20,
        useCondition: 300,
        expiresDate: '2023-06-30 23:59:59'
      },
      {
        id: 34780,
        createdDate: '2023-05-31 17:12:32',
        amount: 20,
        useCondition: 300,
        expiresDate: '2023-06-30 23:59:59'
      },
      {
        id: 34779,
        createdDate: '2023-05-31 17:12:32',
        amount: 20,
        useCondition: 300,
        expiresDate: '2023-06-30 23:59:59'
      },
      {
        id: 34853,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34852,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34851,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34850,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34849,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34848,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34847,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34846,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34845,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34844,
        createdDate: '2023-05-31 17:12:56',
        amount: 20,
        useCondition: 2000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34696,
        createdDate: '2023-05-30 14:28:48',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-07-29 23:59:59'
      },
      {
        id: 34744,
        createdDate: '2023-05-31 07:14:29',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-07-30 23:59:59'
      },
      {
        id: 34690,
        createdDate: '2023-05-30 14:27:04',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-07-29 23:59:59'
      },
      {
        id: 34263,
        createdDate: '2023-05-28 23:05:35',
        amount: 20,
        useCondition: 200,
        expiresDate: '2023-07-27 23:59:59'
      },
      {
        id: 34695,
        createdDate: '2023-05-30 14:28:28',
        amount: 20,
        useCondition: 400,
        expiresDate: '2023-08-28 23:59:59'
      },
      {
        id: 34747,
        createdDate: '2023-05-31 07:14:47',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-30 23:59:59'
      },
      {
        id: 33636,
        createdDate: '2023-05-22 17:34:33',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-21 23:59:59'
      },
      {
        id: 34672,
        createdDate: '2023-05-30 09:28:47',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-29 23:59:59'
      },
      {
        id: 34694,
        createdDate: '2023-05-30 14:27:27',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-29 23:59:59'
      },
      {
        id: 34265,
        createdDate: '2023-05-28 23:06:17',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-27 23:59:59'
      },
      {
        id: 34267,
        createdDate: '2023-05-28 23:06:33',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-27 23:59:59'
      },
      {
        id: 34745,
        createdDate: '2023-05-31 07:14:31',
        amount: 15,
        useCondition: 500,
        expiresDate: '2023-07-30 23:59:59'
      },
      {
        id: 34873,
        createdDate: '2023-05-31 17:12:56',
        amount: 10,
        useCondition: 1000,
        expiresDate: '2026-05-30 23:59:59'
      },
      {
        id: 34588,
        createdDate: '2023-05-29 16:34:23',
        amount: 5,
        useCondition: 300,
        expiresDate: '2023-06-28 23:59:59'
      }
]
const list2 = list.sort((a1, a2) => {
    // return new Date(a1.expiresDate) - new Date(a2.expiresDate) || a2.amount - a1.amount
    return a1.useCondition - a2.useCondition
    // return new Date(a2.useCondition) - new Date(a1.useCondition)
}).map(item => ({
    amount: item.amount,
    useCondition: item.useCondition,
    // expiresDate: item.expiresDate
}))
console.log(list2);
